#include "mainwindow.h"
#include "ui_mainwindow.h"

#include<QPushButton>
#include<QString>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    for (int i=0;i<10 ;i++ ) {
       QString name = QString("按钮 %1").arg(i);
       QPushButton * btn = new QPushButton(name,this);
        btn->setFixedSize(50,50);
        btn->move(i*50,50);
        btn->show();
    }
}

MainWindow::~MainWindow()
{
    delete ui;
}

